package com.ccp.dev.qbdms.controller;

import com.ccp.dev.core.basic.annotion.Action;
import com.ccp.dev.core.basic.consts.UrlConstants;
import com.ccp.dev.core.basic.internationalization.SysBaseController;
import com.ccp.dev.core.basic.util.ContextUtil;
import com.ccp.dev.core.basic.util.PropertyUtil;
import com.ccp.dev.core.basic.util.UUIDUtils;
import com.ccp.dev.core.basic.web.query.QueryFilter;
import com.ccp.dev.core.poi.excel.Excel;
import com.ccp.dev.core.poi.excel.editor.IFontEditor;
import com.ccp.dev.core.poi.excel.reader.DataEntity;
import com.ccp.dev.core.poi.excel.reader.ExcelReader;
import com.ccp.dev.core.poi.excel.reader.FieldEntity;
import com.ccp.dev.core.poi.excel.reader.TableEntity;
import com.ccp.dev.core.poi.excel.style.Color;
import com.ccp.dev.core.poi.excel.style.DataFormat;
import com.ccp.dev.core.poi.excel.style.font.BoldWeight;
import com.ccp.dev.core.poi.excel.style.font.Font;
import com.ccp.dev.core.poi.excel.util.ExcelUtil;
import com.ccp.dev.core.util.BeanUtils;
import com.ccp.dev.core.util.RequestUtil;
import com.ccp.dev.core.util.StringUtil;
import com.ccp.dev.core.util.log.SysAuditThreadLocalHolder;
import com.ccp.dev.qbdms.consts.ZhiLiangConst;
import com.ccp.dev.qbdms.model.WQbdQualityAnalysisReport;
import com.ccp.dev.qbdms.service.WQbdQualityAnalysisReportService;
import com.ccp.dev.qbdms.util.BaseUtil;
import com.ccp.dev.qbdms.util.ProjectUUIDUtils;
import com.ccp.dev.qbdms.util.StructureModifyUtil;
import net.sf.json.JSONObject;
import org.elasticsearch.client.transport.NoNodeAvailableException;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.PrintWriter;
import java.nio.charset.StandardCharsets;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;


/**
 * 质量综合分析报告 信息操作处理控制器
 *
 * @author mi
 * @date 2020-06-22 14:16:42
 */
@Controller
/**
 * 请将此名称添加到日志开关
 */
@Action(customModel = "质量综合分析报告")
@RequestMapping("/qbdms/wQbdQualityAnalysisReport")
public class WQbdQualityAnalysisReportController extends SysBaseController {

    @Resource
    private WQbdQualityAnalysisReportService wQbdQualityAnalysisReportService;


    /**
     * 功能描述: 跳转到首页
     *
     * @return: java.lang.String
     * @auther: mi
     * @date: 2020-06-22 14:16:42
     */
    @RequestMapping(UrlConstants.VIEW_DISPATCH_PREFIX + UrlConstants.MODULE_FUNCTION_LIST)
    @Action(description = "跳转到质量综合分析报告首页", exectype = " 页面跳转日志")
    public String viewList( ModelMap modelMap) {
        modelMap.put("currentUserId", ContextUtil.getCurrentUserId());
        modelMap.put("currentSystemLevel", BaseUtil.getCurrentSystemLevel());
        return "wQbdQualityAnalysisReport/list";
    }

    /**
     * 功能描述: 附带检索条件的分页查询--集团级综合质量分析报告
     *
     * @param: [request] http请求
     * @return: java.lang.Object
     * @auther: mi
     * @date: 2020-06-22 14:16:42
     */
    @RequestMapping(UrlConstants.MODULE_FUNCTION_LIST)
    @ResponseBody
    @Action(description = "附带检索条件的分页查询质量综合分析报告", detail = " 查询数据信息<#if success>成功<#else></#if>")
    public Object list(HttpServletRequest request) {
        QueryFilter queryFilter = new QueryFilter(request, true);
        ZhiLiangConst.addQueryFilter(queryFilter);
        queryFilter.remove("reportStatus");
        //根据系统等级查询数据
        BaseUtil.SystemLevel currentSystemLevel = BaseUtil.getCurrentSystemLevel();
        if (BaseUtil.SystemLevel.GROUPLEVEL.equals(currentSystemLevel)) {
            //集团级查看集团级用户自己新增数据
            queryFilter.put("createByGroup", currentSystemLevel);
        } else if (BaseUtil.SystemLevel.HOSPITALLEVEL.equals(currentSystemLevel)) {
            //院级用户查看集团下发成功的数据
            queryFilter.put("xf", currentSystemLevel);
            queryFilter.put("status", ZhiLiangConst.GROUP_ALREADY_SEND3);
        }else {//三级单位不可见
            queryFilter.put("status","status");
        }
        //默认按照年度倒序排列
        if(queryFilter.get("orderField")==null){
            queryFilter.put("orderField","year");
            queryFilter.put("orderSeq","DESC");
        }

        //分页数据
        List<WQbdQualityAnalysisReport> pageDatas = wQbdQualityAnalysisReportService
                .queryList(queryFilter);

        if (!ObjectUtils.isEmpty(queryFilter.get("content"))){
            pageDatas = wQbdQualityAnalysisReportService.queryES(queryFilter);
            int count= wQbdQualityAnalysisReportService.queryESCount(queryFilter);
            queryFilter.getPageBean().setTotalCount(count);
        }
        SysAuditThreadLocalHolder.putParamerter("success", true);
        return success(pageDatas, queryFilter.getPageBean().getTotalCount());
    }

    /**
     * 功能描述: 跳转到新增页面
     *
     * @return: java.lang.String
     * @auther: mi
     * @date: 2020-06-22 14:16:42
     */
    @RequestMapping(UrlConstants.VIEW_DISPATCH_PREFIX + UrlConstants.MODULE_FUNCTION_ADD_UPDATE)
    @Action(description = "跳转到质量综合分析报告新增页面", exectype = " 页面跳转日志")
    public String viewAdd(HttpServletRequest request, ModelMap modelMap) {
        String id = RequestUtil.getString(request, "id");
        modelMap.put("id", id);
        String fileManagementUploadType = PropertyUtil.getByAlias("QAreportUploadType", "");
        modelMap.put("fileManagementUploadType", fileManagementUploadType);
        String wjszsdsxlx = PropertyUtil.getByAlias("wjszsdsxlx", "");
        modelMap.put("wjszsdsxlx", wjszsdsxlx);
        return "wQbdQualityAnalysisReport/add";
    }

    /**
     * 功能描述:  数据保存通用方法
     *
     * @param: wQbdQualityAnalysisReport 保存的对象
     * @return: java.lang.Object
     * @auther: mi
     * @date: 2020-06-22 14:16:42
     */
    @RequestMapping(UrlConstants.MODULE_FUNCTION_SAVE)
    @ResponseBody
    @Action(description = "保存质量综合分析报告数据", detail = " <#if isAdd>新增<#else>编辑</#if>质量综合分析报告数据 <#if success>成功<#else>失败</#if>" +
            "<#if StringUtil.isNotEmpty(modifyInfo)>${modifyInfo}</#if>")
    public Object save(@RequestBody WQbdQualityAnalysisReport wQbdQualityAnalysisReport) {
        try {
            String id = wQbdQualityAnalysisReport.getId();
            int result;
            if (StringUtil.isEmpty(id)) {
                SysAuditThreadLocalHolder.putParamerter("isAdd", true);
                //新增操作
                //新增数据前生成随机Id
                wQbdQualityAnalysisReport.setId(ProjectUUIDUtils.getUUIDFor32());
                ZhiLiangConst.addCommonFields(wQbdQualityAnalysisReport);
                //下发状态
                BaseUtil.SystemLevel currentSystemLevel = BaseUtil.getCurrentSystemLevel();
                if (BaseUtil.SystemLevel.GROUPLEVEL.equals(currentSystemLevel)) {
                    //集团级用户新增数据 状态 未下发
                    wQbdQualityAnalysisReport.setStatus(ZhiLiangConst.GROUP_PREPARE_SEND);
                } else if (BaseUtil.SystemLevel.HOSPITALLEVEL.equals(currentSystemLevel)) {
                    //院级用户新增数据 状态 待报集团
                    wQbdQualityAnalysisReport.setReportStatus(ZhiLiangConst.REPORT_STATUS_GROUPTOBEREPORTED);
                }

                result = wQbdQualityAnalysisReportService.add(wQbdQualityAnalysisReport);
            } else {
                SysAuditThreadLocalHolder.putParamerter("success", false);
                //修改操作
                ZhiLiangConst.updateCommonFields(wQbdQualityAnalysisReport);
                result = wQbdQualityAnalysisReportService.update(wQbdQualityAnalysisReport);
                //记录修改操作日志
                SysAuditThreadLocalHolder.putParamerter("modifyInfo",
                        StructureModifyUtil.getModifyInfo(wQbdQualityAnalysisReportService.getOneById(id),wQbdQualityAnalysisReport));
            }
            if (result > 0) {
                SysAuditThreadLocalHolder.putParamerter("success", true);
            } else {
                SysAuditThreadLocalHolder.putParamerter("success", false);
            }
            return result > 0 ? getResultDataSuccess("save.success") : getResultDataError("save.failure");
        }catch (NoNodeAvailableException e){
            e.printStackTrace();
            return fail("保存失败！请检查ES服务！");
        } catch (Exception e) {
            e.printStackTrace();
            return getResultDataError("save.failure");
        }
    }




    /**
     * 功能描述: 跳转到详情页面
     *
     * @return: java.lang.String
     * @auther: mi
     * @date: 2020-06-22 14:16:42
     */
    @RequestMapping(UrlConstants.VIEW_DISPATCH_PREFIX + "/particulars")
    @Action(description = "跳转到质量综合分析报告详情页面", exectype = " 页面跳转日志")
    public String viewParticulars(HttpServletRequest request, ModelMap modelMap) {
        String id = RequestUtil.getString(request, "id");
        modelMap.put("id", id);
        String backHos = RequestUtil.getString(request, "backHos");
        modelMap.put("backHos", backHos);
        modelMap.put("isClose", RequestUtil.getString(request, "isClose"));
        return "wQbdQualityAnalysisReport/particulars";
    }

    /**
     * 功能描述: 根据主键id获取一条数据的通用查询方法
     *
     * @param: id 参数对象必须是"id"
     * @return: java.lang.Object
     * @auther: mi
     * @date: 2020-06-22 14:16:42
     */
    @RequestMapping(UrlConstants.MODULE_FUNCTION_GET)
    @ResponseBody
    @Action(description = "根据主键id查询质量综合分析报告的一条数据", detail = " 根据主键id查询质量综合分析报告的数据<#if success>成功<#else>失败</#if>")
    public Object get(@RequestParam("id") String id) {
        WQbdQualityAnalysisReport wQbdQualityAnalysisReport = wQbdQualityAnalysisReportService
                .getOneById(id);
        if (null == wQbdQualityAnalysisReport) {
            SysAuditThreadLocalHolder.putParamerter("success", false);
            return getResultDataError("get.failure");
        }
        SysAuditThreadLocalHolder.putParamerter("success", true);
        return getResultDataSuccess("get.success", wQbdQualityAnalysisReport);
    }

    /**
     * 功能描述: 根据主键ID删除数据的通用删除方法
     *
     * @param: id 参数名称必须是"id"
     * @return: java.lang.Object
     * @auther: mi
     * @date: 2020-06-22 14:16:42
     */
    @PostMapping(UrlConstants.MODULE_FUNCTION_DELETE)
    @ResponseBody
    @Action(description = "根据主键ID删除质量综合分析报告数据", exectype = " 删除日志", detail = " 删除数据信息<#if success>成功<#else>失败</#if>")
    public Object delete(@RequestParam("id") String id,@RequestParam("datatype") String datatype) {
        try {
            String userId = ContextUtil.getCurrentUserId();
            String[] ids = id.split(",");
            for (String key : ids) {
                WQbdQualityAnalysisReport wQbdQualityAnalysisReport = wQbdQualityAnalysisReportService.getOneById(key);
                if ("2".equals(datatype) && Objects.nonNull(wQbdQualityAnalysisReport.getReportStatus())
                        && !ZhiLiangConst.REPORT_STATUS_GROUPTOBEREPORTED.equals(wQbdQualityAnalysisReport.getReportStatus())) {

                    SysAuditThreadLocalHolder.putParamerter("success", false);
                    return fail("删除失败，只允许删除待报集团的数据");
                }
                if ("1".equals(datatype) && Objects.nonNull(wQbdQualityAnalysisReport.getStatus())
                        && !ZhiLiangConst.GROUP_PREPARE_SEND.equals(wQbdQualityAnalysisReport.getStatus())) {

                    SysAuditThreadLocalHolder.putParamerter("success", false);
                    return fail("删除失败，只允许删除待下发的数据");
                }
                if (!userId.equals(wQbdQualityAnalysisReport.getCreateBy())) {
                    SysAuditThreadLocalHolder.putParamerter("success", false);
                    return fail("删除失败，只能删除自己创建的数据！");
                }
            }
            if (StringUtil.isEmpty(id)) {
                SysAuditThreadLocalHolder.putParamerter("success", false);
                return fail("delete.failure.message");
            }
            int result =  wQbdQualityAnalysisReportService.delByIdArray(id);
            if (result > 0) {
                SysAuditThreadLocalHolder.putParamerter("success", true);
            } else {
                SysAuditThreadLocalHolder.putParamerter("success", false);
            }
            return result > 0 ? getResultDataSuccess("delete.success")
                    : getResultDataError("delete.failure");
        } catch (NoNodeAvailableException e){
            e.printStackTrace();
            return fail("删除失败！请检查ES服务！");
        } catch (Exception e) {
            e.printStackTrace();
            return getResultDataError("delete.failure");
        }
    }

    /**
     * 功能描述: 跳转到导入页面
     *
     * @return: java.lang.String
     * @auther: hw
     * @date: 2019-12-25 19:21:40
     */
    @RequestMapping(UrlConstants.VIEW_DISPATCH_PREFIX + "/import")
    @Action(description = "跳转到质量综合分析报告导入页面", exectype = " 页面跳转日志")
    public String viewImport() {
        return "wQbdQualityAnalysisReport/import";
    }

    /**
     * 功能描述: 导出质量综合分析报告 数据信息
     *
     * @param: [request] http请求
     * @return: java.lang.Object
     * @auther: mi
     * @date: 2020-06-22 14:16:42
     */
    @RequestMapping("/exportData")
    @Action(description = "导出质量综合分析报告数据信息", detail = " 导出质量综合分析报告数据信息<#if success>成功<#else></#if>")
    public void export(HttpServletRequest request, HttpServletResponse response) throws Exception {
        String[] id = RequestUtil.getStringAryByStr(request, "id");
        QueryFilter queryFilter = new QueryFilter(request, false);
        if (BeanUtils.isNotEmpty(id) && id.length != 0) {
            queryFilter.put("byId", true);
            queryFilter.put("id", id);
        } else {
            queryFilter.put("byId", false);
        }
        SysAuditThreadLocalHolder.putParamerter("success", true);
        Excel excel = new Excel();
        String fileName = "WQbdQualityAnalysisReport";//导出的文件名称
        excel.sheet().sheetName("sheet");// 重命名当前处于工作状态的表的名称
        List<String> titleList = new ArrayList<>();
        titleList.add("主键ID");
        titleList.add("报告名称");
        titleList.add("年度");
        titleList.add("附件");
        titleList.add("备注");
        titleList.add("状态");
        titleList.add("创建人ID");
        titleList.add("创建时间");
        titleList.add("更新人ID");
        titleList.add("更新时间");
        titleList.add("租户ID");
        excel.row(0, 0).value(titleList.toArray());
        excel.row(0, 0).font(new IFontEditor() {
            // 设置字体
            @Override
            public void updateFont(Font font) {
                font.boldweight(BoldWeight.BOLD);// 粗体
            }
        }).bgColor(Color.GREY_25_PERCENT).width(3500);
        excel.row(0, 1).width(3500);
        excel.row(0, 2).width(3500);
        excel.row(0, 3).width(3500);
        excel.row(0, 4).width(3500);
        //设置列的数据格式
        excel.sheet().setDefaultColumnStyle(0, DataFormat.TEXT);
        excel.sheet().setDefaultColumnStyle(1, DataFormat.TEXT);
        excel.sheet().setDefaultColumnStyle(2, DataFormat.TEXT);
        excel.sheet().setDefaultColumnStyle(3, DataFormat.TEXT);
        ExcelUtil
                .downloadExcel(wQbdQualityAnalysisReportService.exportExcel(excel, queryFilter), fileName,
                        response);
    }

    /**
     * 导入资源文件
     */
    @RequestMapping("/importData")
    public void importData(MultipartHttpServletRequest request, HttpServletResponse response)
            throws Exception {
        MultipartFile multipartFile = request.getFile("file");
        PrintWriter writer = response.getWriter();
        try {
            String fileName = multipartFile.getOriginalFilename();
            String extName = fileName.substring(fileName.lastIndexOf(".") + 1, fileName.length());
            //读取excel文件，并获取每行的数据
            ExcelReader excelReader = new ExcelReader();
            TableEntity excelEntity = excelReader.readFile(multipartFile.getInputStream());
            List<DataEntity> rowDataEntityList = excelEntity.getDataEntityList();

            List<WQbdQualityAnalysisReport> listToInsert = new ArrayList<>();
            for (DataEntity dataEntity : rowDataEntityList) {
                //获取每列的数据
                List<FieldEntity> fieldEntityList = dataEntity.getFieldEntityList();
                WQbdQualityAnalysisReport dataToInsert = new WQbdQualityAnalysisReport();
                int i = 0;
                //根据列的顺序，给相应的对象赋值
                for (FieldEntity fieldEntity : fieldEntityList) {
                    //if(i==0){
                    //dataToInsert.setName(fieldEntity.getValue());
                    //}
                    i++;
                }
                dataToInsert.setId(UUIDUtils.getUUIDFor32());
                listToInsert.add(dataToInsert);
            }
            wQbdQualityAnalysisReportService.addList(listToInsert);
            SysAuditThreadLocalHolder.putParamerter("success", true);
            JSONObject json = JSONObject.fromObject(getResultDataSuccess("operation.success"));
            writer.print(new String(json.toString().getBytes(StandardCharsets.UTF_8),
                    StandardCharsets.ISO_8859_1));
        } catch (Exception e) {
            SysAuditThreadLocalHolder.putParamerter("success", false);
            JSONObject json = JSONObject.fromObject(getResultDataError("operation.failure"));
            writer.print(new String(json.toString().getBytes(StandardCharsets.UTF_8),
                    StandardCharsets.ISO_8859_1));
        }
    }

    @RequestMapping("/xf")
    @ResponseBody
    @Action(description = "根据主键ID下发质量综合分析报告数据", detail = "质量综合分析报告下发信息<#if success>成功<#else>失败</#if>")
    public Object xf(@RequestParam("id") String id) {
        if (StringUtil.isEmpty(id)) {
            SysAuditThreadLocalHolder.putParamerter("success", false);
            return fail("下发失败，未传入数据唯一标识!");
        }
        String[] ids = id.split(",");
        List<WQbdQualityAnalysisReport> updateList = new ArrayList<>();
        for (String key : ids) {
            WQbdQualityAnalysisReport wQbdQualityAnalysisReport = wQbdQualityAnalysisReportService.getOneById(key);
            //下发中或者已下发数据不可再次下发
            if (ZhiLiangConst.GROUP_LOADING_SEND.equals(wQbdQualityAnalysisReport.getStatus())
                    || ZhiLiangConst.GROUP_ALREADY_SEND3.equals(wQbdQualityAnalysisReport.getStatus())) {
                return fail("下发中或者已下发数据不可再次下发!");
            }
            //变更数据状态
            wQbdQualityAnalysisReport.setStatus(ZhiLiangConst.GROUP_LOADING_SEND);
            updateList.add(wQbdQualityAnalysisReport);
        }

        try{
            wQbdQualityAnalysisReportService.updateList(updateList,null);
            //调用下发到院级单位数据接口
            boolean isSuccess=wQbdQualityAnalysisReportService.reportSend(updateList);

            if (isSuccess ) {
                SysAuditThreadLocalHolder.putParamerter("success", true);
                return success("下发成功！");
            } else {
                SysAuditThreadLocalHolder.putParamerter("success", false);
                return fail("下发失败！");
            }
        }catch (Exception e){
            e.printStackTrace();
            wQbdQualityAnalysisReportService.updateList(updateList,ZhiLiangConst.GROUP_FAILURE_SEND2);
            return fail("下发失败！");
        }
    }

//————————————————————————————————————————————————院级质量综合分析报告——————————————————————————————————————————————————

    /**
     * 功能描述: 院级-跳转到首页
     *
     * @return: java.lang.String
     * @auther: wyl
     * @date: 2020-06-29
     */
    @RequestMapping(UrlConstants.VIEW_DISPATCH_PREFIX + UrlConstants.MODULE_FUNCTION_LIST + "Hospital")
    @Action(description = "跳转到院级质量综合分析报告首页", exectype = " 页面跳转日志")
    public String viewListHospital(HttpServletRequest request, ModelMap modelMap) {
        modelMap.put("currentUserId", ContextUtil.getCurrentUserId());
        modelMap.put("currentSystemLevel", BaseUtil.getCurrentSystemLevel());
        return "wQbdQualityAnalysisReport/listHospital";
    }

    /**
     * 功能描述: 院级-附带检索条件的分页查询
     *
     * @param: [request] http请求
     * @return: java.lang.Object
     * @auther: wyl
     * @date: 2020-06-29
     */
    @RequestMapping(UrlConstants.MODULE_FUNCTION_LIST + "Hospital")
    @ResponseBody
    @Action(description = "附带检索条件的分页查询院级质量综合分析报告", detail = " 查询数据信息<#if success>成功<#else></#if>")
    public Object listHospital(HttpServletRequest request) throws IllegalAccessException {
        QueryFilter queryFilter = new QueryFilter(request, true);
        ZhiLiangConst.addQueryFilter(queryFilter);
        //默认按照年度倒序排列
        if(queryFilter.get("orderField")==null){
            queryFilter.put("orderField","year");
            queryFilter.put("orderSeq","DESC");
        }
        //分页数据
        List<WQbdQualityAnalysisReport> pageDatas = wQbdQualityAnalysisReportService
                .queryList(queryFilter);

        if (!ObjectUtils.isEmpty(queryFilter.get("content"))){
            pageDatas = wQbdQualityAnalysisReportService.queryES(queryFilter);
            int count= wQbdQualityAnalysisReportService.queryESCount(queryFilter);
            queryFilter.getPageBean().setTotalCount(count);
        }
        ZhiLiangConst.showName(pageDatas);
        ZhiLiangConst.isDataAllowEdit(pageDatas, false);
        SysAuditThreadLocalHolder.putParamerter("success", true);
        return success(pageDatas, queryFilter.getPageBean().getTotalCount());
    }

    /**
     * 功能描述: 院级-跳转到新增页面
     *
     * @return: java.lang.String
     * @auther: wyl
     * @date: 2020-06-29
     */
    @RequestMapping(UrlConstants.VIEW_DISPATCH_PREFIX + UrlConstants.MODULE_FUNCTION_ADD_UPDATE + "Hospital")
    @Action(description = "跳转到院级质量综合分析报告新增页面", exectype = " 页面跳转日志")
    public String viewAddHospital(HttpServletRequest request, ModelMap modelMap) {
        String id = RequestUtil.getString(request, "id");
        modelMap.put("id", id);

        String fileManagementUploadType = PropertyUtil.getByAlias("QAreportUploadType", "");
        modelMap.put("fileManagementUploadType", fileManagementUploadType);
        String wjszsdsxlx = PropertyUtil.getByAlias("zlfxbgwjlxsx", "");
        modelMap.put("wjszsdsxlx", wjszsdsxlx);
        return "wQbdQualityAnalysisReport/addHospital";
    }

    /**
     * 查询上报的信息
     *
     * @param request
     * @param id
     * @param tableName
     * @return
     */
    @RequestMapping("/reportList")
    @ResponseBody
    public Object reportList(HttpServletRequest request, @RequestParam("id") String id, @RequestParam("tableName") String tableName) {
        //业务数据
        List<WQbdQualityAnalysisReport> reportList = wQbdQualityAnalysisReportService.reportList(id, tableName);
        SysAuditThreadLocalHolder.putParamerter("success", true);
        return getResultDataSuccess("options.success", reportList);
    }
}
